class  Animal{
    public String name;
    public int age;

    public Animal(String name, int age) {
        this.name = name;
        this.age = age;
        System.out.println("Animal(String name, int age)");
    }
    public void eat(){
        System.out.println(this.name+"正在吃");
    }
}
class Dog extends Animal{
    public String color;

    public Dog(String name,int age,String color) {
        //调用父类的 带有2个参数的构造方法 来初始化父类当中成员 必须在第一行 所以，super()和this() 是不能同时存在的
        super(name,age);
        this.color = color;
        System.out.println("Dog(String name,int age,String color)");
    }
     public void barks(){
         System.out.println(this.name+"正在汪汪叫");
     }
}
/*class Cat extends Animal{

    public void miao(){
        System.out.println(this.name+"正在喵喵叫");
    }
}*/
public class Test {
    public static void main(String[] args) {
    Dog dog = new Dog("小黄",12,"黄色");
    //dog.name = "小黄";
    dog.eat();
   /* Cat cat = new Cat();
    cat.name = "小美";
    cat.miao();*/
    }
}
